package com.bw.itext.pdf;

import com.bw.itext.pdf.service.PdfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties(PdfProperties.class)
public class PdfAutoConfigurationProperties {

    @Autowired
    private PdfProperties properties;
    @Bean
    @ConditionalOnProperty(prefix = "pdf",value = "enable",havingValue = "true")
    public PdfService pdfService(){
        return new PdfService(properties);
    }


}
